<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*  let fn = () => {
             console.log(this) // window
             console.log('es6')
         }
         fn() */
        let age = 'zsage'
        let name = 'zs'
        let obj = {
            name,
            sayHi: function () {
                console.log('sayHi', this)
            },
            sayEs6: () => {
                console.log('sayEs6')
            },
            [age]: 16,
        }

        console.log(obj)

        //es5 this 函数执行的时候才决定
        // 箭头函数的this的指向  箭头函数里面没有this  箭头的this 在这个函数被定义的时候就已经决定了
    </script>
</body>

</html>